﻿using WebAPI.Models;

namespace WebAPI.Common.Attributes
{
    [AttributeUsage(AttributeTargets.Method)]
    public class LogAttribute : System.Attribute
    {
        /// <summary>
        /// 操作类型
        /// </summary>
        public Enums.LogType LogType { get; set; }

        public string Module { get; set; }

        public string SubModule { get; set; }

        public string Description { get; set; }

        /// <summary>
        /// 是否保存请求数据
        /// </summary>
        public bool IsSaveRequestData { get; set; } = true;

        /// <summary>
        /// 是否保存返回数据
        /// </summary>
        public bool IsSaveResponseData { get; set; } = true;

        public LogAttribute(string module, string subModule, string description = "", Enums.LogType LogType = Enums.LogType.AdministratorAccountLog)
        {
            this.Module = module;
            this.SubModule = subModule;
            this.Description = description;
            this.LogType = LogType;
        }
    }
}
